package com.example.activityproject;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import java.io.Serializable;

public class BlueAct  extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.blue_activity_layout);
        Intent intent = getIntent();
       // 获取到user对象，通过传值界面可知，传递的是Serializable实现类，所以getSerializableExtra方法获取
//        User user = (User) intent.getSerializableExtra("user_key");
//        Log.i("BlueTag","名字："+user.getName()+" ,年龄："+user.getAge());

        Button to_oneact_bt = findViewById(R.id.to_oneact_bt);
        to_oneact_bt.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent1 = new Intent(BlueAct.this, OneActivity.class);
                intent1.putExtra("msg","BlueAct设置的值1000");
                BlueAct.this.startActivity(intent1);
            }
        });
    }
}
